#include <iostream>
#include <vector>

using namespace std;

bool canPlaceTiles(vector<vector<int> >& grid, vector<pair<int, int> >& tiles, int H, int W, int idx) {
    if (idx == tiles.size()) {
        for (int i = 0; i < H; ++i)
            for (int j = 0; j < W; ++j)
                if (grid[i][j] == 0) return false; // Check if any cell is not covered
        return true; // All cells are covered
    }

    int A = tiles[idx].first, B = tiles[idx].second;
    // Try placing the tile at every possible position and orientation
    for (int i = 0; i < H; ++i) {
        for (int j = 0; j < W; ++j) {
            // Try placing with original orientation
            if (i + A <= H && j + B <= W) {
                bool canPlace = true;
                for (int x = i; x < i + A && canPlace; ++x)
                    for (int y = j; y < j + B && canPlace; ++y)
                        if (grid[x][y] != 0) canPlace = false;

                if (canPlace) {
                    for (int x = i; x < i + A; ++x)
                        for (int y = j; y < j + B; ++y)
                            grid[x][y] = idx + 1;

                    if (canPlaceTiles(grid, tiles, H, W, idx + 1)) return true;

                    for (int x = i; x < i + A; ++x)
                        for (int y = j; y < j + B; ++y)
                            grid[x][y] = 0;
                }
            }

            // Try placing with rotated orientation
            if (i + B <= H && j + A <= W && A != B) {
                bool canPlace = true;
                for (int x = i; x < i + B && canPlace; ++x)
                    for (int y = j; y < j + A && canPlace; ++y)
                        if (grid[x][y] != 0) canPlace = false;

                if (canPlace) {
                    for (int x = i; x < i + B; ++x)
                        for (int y = j; y < j + A; ++y)
                            grid[x][y] = idx + 1;

                    if (canPlaceTiles(grid, tiles, H, W, idx + 1)) return true;

                    for (int x = i; x < i + B; ++x)
                        for (int y = j; y < j + A; ++y)
                            grid[x][y] = 0;
                }
            }
        }
    }
    return false; // No valid placement found for this tile
}

int main() {
    int N, H, W;
    cin >> N >> H >> W;

    vector<pair<int, int> > tiles(N);
    for (int i = 0; i < N; ++i) {
        cin >> tiles[i].first >> tiles[i].second;
    }

    vector<vector<int> > grid(H, vector<int>(W, 0)); // Initialize a grid with all cells uncovered

    if (canPlaceTiles(grid, tiles, H, W, 0)) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}
